﻿@{
    ViewBag.Title = "添加";
    Layout = "../Shared/_Layout.cshtml";
}
@using mscook.mvc;
@model mscook.core.domain.LoginUser

@section JavaScript
{
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.validate.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.validate.unobtrusive.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.unobtrusive-ajax.js")"></script>
}

<div class="row-fluid sortable">
    <div class="box span12">
        <div class="box-header well">
            <h2><i class="icon-edit"></i></h2>
            <div class="box-icon">
                <a href="@Url.Action("Add")" class="btn btn-setting btn-round"><i class="icon-plus-sign"></i></a>
            </div>
        </div>
        <div class="box-content">
            @using (Html.BeginForm("Add", "account", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal" }))
            {
                <fieldset>
                    <legend>管理人员增加</legend>
                    <div class="control-group">
                        <label class="control-label">用户名</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(loginUser => loginUser.LoginName, new { size = "16"})


                            </div>
                            @Html.ValidationMessageFor(loginUser => loginUser.LoginName)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">密码</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(loginUser => loginUser.Password, new { size = "16" })

                            </div>
                            @Html.ValidationMessageFor(loginUser => loginUser.Password)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">邮箱</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(loginUser => loginUser.Email, new { size = "16" })

                            </div>
                            @Html.ValidationMessageFor(loginUser => loginUser.Email)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">角色</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @{
                var itemList = new List<SelectListItem>();
                itemList.Add(new SelectListItem() { Text = "管理员", Value = "admin", Selected = true });
                itemList.Add(new SelectListItem() { Text = "编辑人员", Value = "editor", Selected = false });
                                    @Html.DropDownListFor(loginUser => loginUser.UserRole, itemList);
                                       
                                }
                            </div>
                        </div>
                    </div>



                    <div class="form-actions">
                        <button type="submit" class="btn btn-primary btn-large">保存</button>
                        <button class="btn btn-large">Cancel</button>
                    </div>
                </fieldset>
            }
        </div>
    </div>
    <!--/span-->

</div>
